Optimal. Leaf size=83 \[ \frac {c x}{e g}+\frac {\left (c d^2-b d e+a e^2\right ) \log (d+e x)}{e^2 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right ) \log (f+g x)}{g^2 (e f-d g)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.040, Rules used = {907}
\begin {gather*} \frac {\log (d+e x) \left (a e^2-b d e+c d^2\right )}{e^2 (e f-d g)}-\frac {\log (f+g x) \left (a g^2-b f g+c f^2\right )}{g^2 (e f-d g)}+\frac {c x}{e g} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 907
Rubi steps
\begin {align*} \int \frac {a+b x+c x^2}{(d+e x) (f+g x)} \, dx &=\int \left (\frac {c}{e g}+\frac {c d^2-b d e+a e^2}{e (e f-d g) (d+e x)}+\frac {c f^2-b f g+a g^2}{g (-e f+d g) (f+g x)}\right ) \, dx\\ &=\frac {c x}{e g}+\frac {\left (c d^2-b d e+a e^2\right ) \log (d+e x)}{e^2 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right ) \log (f+g x)}{g^2 (e f-d g)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 85, normalized size = 1.02 \begin {gather*} \frac {c x}{e g}-\frac {\left (-c d^2+b d e-a e^2\right ) \log (d+e x)}{e^2 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right ) \log (f+g x)}{g^2 (e f-d g)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 84, normalized size = 1.01
method | result | size |
default | \(\frac {c x}{e g}+\frac {\left (-a \,e^{2}+b d e -c \,d^{2}\right ) \ln \left (e x +d \right )}{\left (d g -e f \right ) e^{2}}+\frac {\left (a \,g^{2}-b f g +c \,f^{2}\right ) \ln \left (g x +f \right )}{g^{2} \left (d g -e f \right )}\) | \(84\) |
norman | \(\frac {c x}{e g}+\frac {\left (a \,g^{2}-b f g +c \,f^{2}\right ) \ln \left (g x +f \right )}{g^{2} \left (d g -e f \right )}-\frac {\left (a \,e^{2}-b d e +c \,d^{2}\right ) \ln \left (e x +d \right )}{\left (d g -e f \right ) e^{2}}\) | \(84\) |
risch | \(\frac {c x}{e g}+\frac {\ln \left (-g x -f \right ) a}{d g -e f}-\frac {\ln \left (-g x -f \right ) b f}{g \left (d g -e f \right )}+\frac {\ln \left (-g x -f \right ) c \,f^{2}}{g^{2} \left (d g -e f \right )}-\frac {\ln \left (e x +d \right ) a}{d g -e f}+\frac {\ln \left (e x +d \right ) b d}{\left (d g -e f \right ) e}-\frac {\ln \left (e x +d \right ) c \,d^{2}}{\left (d g -e f \right ) e^{2}}\) | \(151\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 86, normalized size = 1.04 \begin {gather*} \frac {c x e^{\left (-1\right )}}{g} + \frac {{\left (c f^{2} - b f g + a g^{2}\right )} \log \left (g x + f\right )}{d g^{3} - f g^{2} e} - \frac {{\left (c d^{2} - b d e + a e^{2}\right )} \log \left (x e + d\right )}{d g e^{2} - f e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.22, size = 96, normalized size = 1.16 \begin {gather*} \frac {c d g^{2} x e - c f g x e^{2} + {\left (c f^{2} - b f g + a g^{2}\right )} e^{2} \log \left (g x + f\right ) - {\left (c d^{2} g^{2} - b d g^{2} e + a g^{2} e^{2}\right )} \log \left (x e + d\right )}{d g^{3} e^{2} - f g^{2} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 420 vs.
\(2 (70) = 140\).
time = 74.15, size = 420, normalized size = 5.06 \begin {gather*} \frac {c x}{e g} + \frac {\left (a g^{2} - b f g + c f^{2}\right ) \log {\left (x + \frac {a d e g^{2} + a e^{2} f g - 2 b d e f g + c d^{2} f g + c d e f^{2} - \frac {d^{2} e g \left (a g^{2} - b f g + c f^{2}\right )}{d g - e f} + \frac {2 d e^{2} f \left (a g^{2} - b f g + c f^{2}\right )}{d g - e f} - \frac {e^{3} f^{2} \left (a g^{2} - b f g + c f^{2}\right )}{g \left (d g - e f\right )}}{2 a e^{2} g^{2} - b d e g^{2} - b e^{2} f g + c d^{2} g^{2} + c e^{2} f^{2}} \right )}}{g^{2} \left (d g - e f\right )} - \frac {\left (a e^{2} - b d e + c d^{2}\right ) \log {\left (x + \frac {a d e g^{2} + a e^{2} f g - 2 b d e f g + c d^{2} f g + c d e f^{2} + \frac {d^{2} g^{3} \left (a e^{2} - b d e + c d^{2}\right )}{e \left (d g - e f\right )} - \frac {2 d f g^{2} \left (a e^{2} - b d e + c d^{2}\right )}{d g - e f} + \frac {e f^{2} g \left (a e^{2} - b d e + c d^{2}\right )}{d g - e f}}{2 a e^{2} g^{2} - b d e g^{2} - b e^{2} f g + c d^{2} g^{2} + c e^{2} f^{2}} \right )}}{e^{2} \left (d g - e f\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.68, size = 88, normalized size = 1.06 \begin {gather*} \frac {c x e^{\left (-1\right )}}{g} + \frac {{\left (c f^{2} - b f g + a g^{2}\right )} \log \left ({\left | g x + f \right |}\right )}{d g^{3} - f g^{2} e} - \frac {{\left (c d^{2} - b d e + a e^{2}\right )} \log \left ({\left | x e + d \right |}\right )}{d g e^{2} - f e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.42, size = 84, normalized size = 1.01 \begin {gather*} \frac {\ln \left (d+e\,x\right )\,\left (c\,d^2-b\,d\,e+a\,e^2\right )}{e^3\,f-d\,e^2\,g}+\frac {\ln \left (f+g\,x\right )\,\left (c\,f^2-b\,f\,g+a\,g^2\right )}{g^2\,\left (d\,g-e\,f\right )}+\frac {c\,x}{e\,g} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________